<?php

namespace frontend\modules\yii\models;

use Yii;

/**
 * This is the model class for table "frame_articles".
 *
 * @property int $id
 * @property string $title The title of article.
 * @property string $markdown The markdown format of article.
 * @property string $html The html format of article.
 * @property string $nav The nav route. controller/action
 * @property int $dir 1: is dir; 2: file
 * @property int $pid The parent dir id.
 * @property int $created_at The create time of this article
 * @property int $updated_at The last update time of this article
 */
class FrameArticles extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'frame_articles';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['markdown', 'html'], 'required'],
            [['markdown', 'html'], 'string'],
            [['dir', 'pid', 'created_at', 'updated_at'], 'integer'],
            [['title', 'nav'], 'string', 'max' => 100],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'markdown' => 'Markdown',
            'html' => 'Html',
            'nav' => 'Nav',
            'dir' => 'Dir',
            'pid' => 'Pid',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
